/**
 * 作者: heweiping
 * 日期: 2025-04-22 16:00:07
 * 备注: 用户万能活动任务表
 */
package com.motu.monstercity.server.game.userdata;

import com.motu.monstercity.server.game.commondata.act.ActConventionTask;
import com.motu.monstercity.server.game.commondata.act.ActTask;
import com.motu.monstercity.server.game.logic.ActConventionBaseData;
import com.motu.monstercity.server.game.logic.ActConventionManager;
import com.motu.monstercity.server.game.logic.ActDaysManager;
import com.motu.vertx.module.utility.toolset.TimeUtils;

public class UserActConventionTask extends UserActConventionTaskModel {
    public UserActConventionTask() {
        super();
    }
    public UserActConventionTask(long userId, int taskTypeId) {
        super();
        putUserId(userId);
        putTaskType(taskTypeId);
        putResetTime(TimeUtils.getCurTime());
    }

    public void reset() { // 每日重置任务
        ActConventionTask task = ActConventionBaseData.getActConventionTasksByTaskTypeId(taskType);
        if (task == null) {
            return;
        }
        if (!TimeUtils.isToday(resetTime)) {
            if (task.getType() == ActConventionTask.CONVENTION_RESET_DAILY) {
                putCurP(0);
                putGetReward("");
            }
            putResetTime(TimeUtils.getCurTime());
            update();
        }
    }
}
